package zhishuang.wang.sansi.playlist.fcms;

/**
 * @Author Zhishuang.Wang
 * @Date 2023/7/5 11:11
 * @Email 1406110602@qq.com
 */

import zhishuang.wang.sansi.playlist.AreaItem;
import zhishuang.wang.sansi.playlist.PageItem;
import zhishuang.wang.sansi.playlist.PlayItem;
import zhishuang.wang.sansi.playlist.entry.Animation;
import zhishuang.wang.sansi.playlist.entry.AreaPositon;
import zhishuang.wang.sansi.playlist.entry.Background;
import zhishuang.wang.sansi.playlist.entry.BaseColour;
import zhishuang.wang.sansi.playlist.entry.PictureBase;
import zhishuang.wang.sansi.playlist.entry.PlayTimeBase;
import zhishuang.wang.sansi.playlist.entry.TextBase;
import zhishuang.wang.sansi.tools.ReturnData;
import java.util.ArrayList;
import java.util.List;

public class PlayListDemo {
    public PlayListDemo() {
    }

    public static void testFcmsPlay() {
        Animation animation = new Animation();
        animation.setInAnimation(3);
        animation.setInAnimationSpeed(20);
        TextBase textBase = new TextBase(0, "你好！FCMS ====测试");
        textBase.setFontSize("16,16");
        textBase.setFontName("s");
        textBase.setWordSpace(8);
        BaseColour fontColour = new BaseColour(128, 128, 128, 0, 0);
        textBase.setFontColour(fontColour);
        PlayTimeBase textPlayTime = new PlayTimeBase(10000);
        PlayItem textPlayItem = new PlayItem(1, "test", "31332", textBase, textPlayTime);
        textPlayItem.setAnimation(animation);
        textPlayItem.setX(10);
        textPlayItem.setY(10);
        PlayTimeBase pictPlayTime = new PlayTimeBase(30000);
        PictureBase pictureBase = new PictureBase(0, "r64.bmp");
        PlayItem picturePlayItem = new PlayItem(2, "picture", "1321321", pictureBase, pictPlayTime);
        picturePlayItem.setAnimation(animation);
        List<PlayItem> playItemList = new ArrayList();
        playItemList.add(textPlayItem);
        playItemList.add(picturePlayItem);
        Background background = new Background();
        BaseColour backColour = new BaseColour(255, 255, 255, 255, 255);
        background.setBackColour(backColour);
        AreaPositon areaPositon = new AreaPositon(0, 0, 192, 500, 0);
        AreaItem areaItem = new AreaItem("1213221", "321321", areaPositon, playItemList);
        areaItem.setBackground(background);
        AreaPositon areaPositon1 = new AreaPositon(0, 192, 192, 500, 0);
        AreaItem areaItem1 = new AreaItem("1213221", "321321", areaPositon1, playItemList);
        List<AreaItem> areaItemList = new ArrayList();
        areaItemList.add(areaItem);
        areaItemList.add(areaItem1);
        PageItem pageItem = new PageItem("121321", "nasfafafa", areaItemList);
        PlayListFcms plf = new PlayListFcms();
        ReturnData rd = plf.createFcmsPlayList("E:\\downtest\\bmp\\play.lst", pageItem);
        System.out.println("====" + rd.getCode());
        System.out.println("====" + rd.getMessage());
    }
}
